package com.tour.controller;


import com.tour.config.ResponseWrapper;
import com.tour.entity.FComment;
import com.tour.service.impl.FCommentServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lel
 * @since 2021-03-30
 */
@RestController
@Api(tags = "餐厅评论管理")
@RequestMapping("/app")
public class FCommentController {

    @Autowired
    FCommentServiceImpl commentService;

    @ApiOperation("增加美食评论")
    @PostMapping("/addFcomment")
    public ResponseWrapper addFcomment(@RequestBody FComment comment){
        ResponseWrapper wrapper = commentService.addsComment(comment);
        return wrapper;
    }

    @ApiOperation("删除评论")
    @DeleteMapping("/deleteFcomment")
    @ApiImplicitParam(name="fcid",value = "评论id")
    public ResponseWrapper deleteFComment(Integer fcid){
        ResponseWrapper wrapper = commentService.deleteComment(fcid);
        return wrapper;
    }
}

